# 作者：SP
# 开发时间：2024/1/10 22:02
import json
#如果以前存储了用户名，就加载它
#否则，提示用户输入用户名并存储它
filename = 'username.json'
try:
    with open(filename,'r') as f:
        content = json.load(f)
    print(content)
except FileNotFoundError:
    name = input("what's your name:")
    with open(filename,'w') as f:
        json.dump(name,f)
        print(f"we will remember you {name}")
else:
    print(f'welcome {content}')